<template>
  <div>
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
      <el-form-item label="日期">
        <el-date-picker
          v-model="dateRange"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="['00:00:00', '23:59:59']"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="长" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="长"
          clearable
          style="width: 120px;"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="宽" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="宽"
          clearable
          style="width: 120px;"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <Table
      ref="tableref"
      :tableHeader="tableHeader"
      :table="{height:'calc(100vh - 250px)'}"
    >
      <template slot="table-operate" slot-scope="scope">
        <el-link @click="handleCopy(scope.row)" type="primary" :underline="false">复制</el-link>
      </template>
    </Table>
    <el-dialog :title="title" :visible.sync="dialogVisible" :close-on-click-modal="false">
      <CopyAdd ref="CopyAdd"/>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import CopyAdd from './CopyAdd'
import Table from '@/components/Table'

export default {
  name: 'ConfirmOrderAddList',
  components: { CopyAdd, Table },
  data() {
    return {
      dialogVisible: false,
      title: '创建',
      tableHeader: [
        { label: '网单号码', prop: '', fixed: 'left', width: '' },
        { label: '下单时间', prop: '', fixed: 'left', width: '' },
        { label: '状态', prop: '', fixed: 'left', width: '' },
        { label: '客户名称', prop: '', fixed: 'left', width: '' },
        { label: '客户编号', prop: '', width: '' },
        { label: '材质', prop: '', width: '' },
        { label: '楞型', prop: '', width: '' },
        { label: '长度', prop: '', width: '' },
        { label: '宽度', prop: '', width: '' },
        { label: '数量', prop: '', width: '' },
        { label: '毛净片', prop: '', width: '' },
        { label: '压型', prop: '', width: '' },
        { label: '压线', prop: '', width: '' },
        { label: '收货地址', prop: '', width: '' },
        { label: '收货标识', prop: '', width: '' },
        // { label: '收货时间', prop: '', width: '' },
        { label: '其他备注', prop: '', width: '' },
        { label: '质量备注', prop: '', width: '' },
        { label: '客户PO', prop: '', width: '' }
      ],
      selectoption: [
        {
          label: '未提交',
          value: 1
        },
        {
          label: '审批拒绝',
          value: 2
        }
      ],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        ipaddr: undefined,
        userName: undefined,
        status: undefined
      }
    }
  },
  created() {
    // this.getList()
  },
  methods: {
    /**
     * 复制
     **/
    handleCopy(row){
      this.dialogVisible=true

    },
    /**
     * 获取列表
     **/
    getList(){

    },

    /**
     * TODO 搜索按钮操作
     * */
    handleQuery() {
      this.queryParams.pageNum = 1
    },
    /**
     * TODO 重置按钮操作
     * */
    resetQuery() {
      this.dateRange = []
      this.queryParams.pageNum = 1
    }
  }
}
</script>

